#include <iostream>
#include <list>
#include <algorithm>
using namespace std;

int main(){
	list<int> col1;
	
	// insert elements from 6 to 1 and 1 to 6
	for(int i=1;i<=6;i++){
		col1.push_front(i);
		col1.push_back(i);
	}
	
	// remove all elements with value 3
	col1.erase(remove(col1.begin(),col1.end(),3),col1.end());
	
	// remove all elements with value 4
	col1.remove(4);
	
	// print modified list
	copy(col1.begin(),col1.end(),ostream_iterator<int>(cout," "));
	cout << endl;
	
	return 0;
}